<?php
namespace Common\Model;
use Think\Model;
class ComplaintModel extends Model {
    /**
     * model的中文名称
     */
    public $modelName = '投诉';

    /**
     * model的icon
     */
    public $modelIcon = 'icon-envelope';
    
    protected $_auto = [
        ["create_time", "strtotime", 3, "function"],
        ["update_time", "strtotime", 3, "function"],
        ["create_time", "time", 1, "function"],
        ["update_time", "time", 2, "function"],
    ];
    protected $_validate = [
        ["id", "require", "ID必须填写!"],
        ["user_id", "require", "用户必须填写!"],
        ["order_id", "require", "订单ID必须填写!"],
        ["order_type", "require", "订单类型必须填写!"],
        ["content", "require", "投诉内容必须填写!"],
        ["state", "require", "处理状态必须填写!"],
        ["create_time", "require", "创建时间必须填写!"],
        ["update_time", "require", "更新时间必须填写!"],
    ];
    public $excel = false;
    public $fieldMap = [
        "id"=>[
            "type"=>"input",
            "name"=>"ID",
            "list"=>true,
            "search"=>true,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "user_id"=>[
            "type"=>"foreign",
            "name"=>"用户",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"user,id,name,input",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "order_id"=>[
            "type"=>"input",
            "name"=>"订单ID",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center"><a href="{:U($vo[\'order_type\'].\'/detail\', [\'id\'=>$vo[\'order_id\']])}">{$vo[\'order_id\']}</a></td>',
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "order_type"=>[
            "type"=>"input",
            "name"=>"订单类型",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>'<td class="center">{:C("COMMENT_EN_TO_CH")[$vo["order_type"]]}</td>',
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "content"=>[
            "type"=>"input",
            "name"=>"投诉内容",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "state"=>[
            "type"=>"select",
            "name"=>"处理状态",
            "list"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"未处理,已处理",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "create_time"=>[
            "type"=>"datetime",
            "name"=>"创建时间",
            "list"=>true,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "update_time"=>[
            "type"=>"datetime",
            "name"=>"更新时间",
            "list"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
    ];
}